// SensorSpace.h
// still not clear?? is it necessary? We already have Node class..
// hmmm. think about this more..
// by Mina Jung @ syracuse university
// April 2010

#import <objectbase/SwarmObject.h>
#import <space.h>


@class Sensor;


// An abstract type of Error.
typedef int SensedValue;


typedef enum {NotActive=151, Active=150, Die=152} SensorState;


@interface SensorSpace: SwarmObject 
{
  unsigned int Xsize,Ysize;			// grid size;
  
  id <Grid2d> environmentGrid;			// environmental values at each spot, which will be sensed by sensor nodes 
  
  id <Discrete2d> EnvironmentValues;		// environmental values at each spot, which will be sensed by sensor nodes --> normal vs abnormal 

  id <Grid2d> sensorGrid;			// sensor node grid

}

- setSizeX:(int)x Y: (int)y;
- (int)getSizeX;
- (int)getSizeY;

- initializeEnvironment;

- updateEnvironmentValues;

- setWallAtX: (int)x Y: (int)y;

- updateEnvironment:(SensedValue)val atX: (int)x Y:(int)y A:(int)a;
- (SensedValue)getEnvironmentValueAtX:(int)x Y:(int)y A:(int)a;


- (Sensor*)getSensorAtX:(int) x Y: (int)y;
- addSensor: (Sensor*)sensor atX: (int) x Y: (int)y;
- removeSensor: (Sensor *)sesnor;
- moveSesnor: (Sensor *)sensor toX: (int)x Y: (int)y;
 
- (id <Discrete2d>)getEnvironmentValues;

- (id <Grid2d>)getSensorGrid;

- (int)xNorm: (int)x;
- (int)yNorm: (int)y;


@end

